﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

namespace OnlineBusTicket.User
{
    public partial class CreateRole : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnCreateRole_Click(object sender, EventArgs e)
        {
           // check role exist ?
            if (Roles.RoleExists(txtRoleName.Text))
            {
                lblStatus.Text= string.Format("Role '{0}' is exist", txtRoleName.Text);
                return;
            }
           // create new role
            Roles.CreateRole(txtRoleName.Text);

            Response.Redirect("ListAllUserRole.aspx");
        }
    }
}